<template>
  <div>
    <el-dialog
      :visible.sync="dialogVisible"
      width="300px">
      <img :src="icon">
      <div class="tip">{{tip}}</div>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    props: {
      tip: {
        type: String,
        default: '成功'
      },
      icon: {
        type: String,
        default: require('@/assets/image/success.png')
      }
    },
    data() {
      return {
        dialogVisible: false
      }
    },
    methods: {
      show() {
        this.dialogVisible = true
      },
      close() {
        this.dialogVisible = false
      }
    },
  }
</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  // height: 100%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  .el-dialog__body {
    padding: 0 0 20px 0;
  }
  img {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
  }
  .tip {
    font-size: 12px;
    color: #666;
  }
}
</style>